home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / wnos / wn941101 / mailbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-09  |  4.9 KB  |  107 lines

  1. #ifndef _MAILBOX_H
  2. #define _MAILBOX_H
  3.  
  4. /* Defines for the ax.25 mailbox facility */
  5. #define NUMMBX          10              /* max number of mailbox sessions */
  6.  
  7. #ifndef _TIMER_H
  8. #include "timer.h"
  9. #endif
  10.  
  11. #define MBXLINE         128             /* max length of line */
  12.  
  13. struct mbx {
  14.     int state ;                             /* mailbox state */
  15. #define MBX_LOGIN       0               /* trying to log in */
  16. #define MBX_CMD         1               /* in command mode */
  17. #define MBX_SUBJ        2               /* waiting for a subject line */
  18. #define MBX_DATA        3               /* collecting the message */
  19. #define MBX_REVFWD      4               /* reverse forwarding in progress */
  20. #define MBX_TRYING      5               /* pending forwarding connection */
  21. #define MBX_FORWARD     6               /* established forwarding connection */
  22. #define MBX_CONVERS 7           /* conversd implementation - DB3FL */
  23.     char name[20] ;                 /* Name of remote station */
  24.     char nodename[20];
  25.     char *to ;                              /* To-address in form user or user@host */
  26.     char *origto ;                  /* Original To-address, if rewritten */
  27.     char *tofrom ;                  /* Optional <from in to-address */
  28.     char *tomsgid ;                 /* Optional $msgid in to-address */
  29.     FILE *tfile ;                   /* Temporary file for message, or */
  30.                             /* forwarding file. */
  31.     char line[MBXLINE+1] ;  /* Room for null at end */
  32.     int mbnum ;                             /* which mailbox session is this? */
  33.     int sid ;                               /* Characteristics indicated by the SID */
  34.                             /* banner of the attaching station.  If */
  35.                             /* no SID was sent, this is zero.  If an */
  36.                             /* SID of any kind was received, it is */
  37.                             /* assumed that the station supports */
  38.                             /* abbreviated mail forwarding mode. */
  39. #define MBX_SID           0x01  /* Got any SID */
  40. #define MBX_RLI_SID       0x02  /* This is an RLI BBS, disconnect after F> */
  41. #define MBX_HIER_SID  0x04      /* The BBS supports "hierarchical routing */
  42.                             /* designators." */
  43.                             /* Space here for others, currently not of */
  44.                             /* interest to us. */
  45.     char stype ;                    /* BBS send command type (B,P,T, etc.) */
  46.     int type ;                              /* Type of session when invoking "chat" */
  47.     int family;                             /* Type of uplink session */
  48.     int user;                               /* User linkage area */
  49.     char escape;                    /* Escape character */
  50.     int privs;                              /* Privileges (taken from Ftpusers file) */
  51. #define AX25_CMD                8       /* AX.25 gateway operation allowed */
  52. #define TELNET_CMD              16      /* Telnet gateway operation allowed */
  53. #define NETROM_CMD              32      /* NET/ROM gateway operation allowed */
  54. #define SYSOP_CMD               64      /* Remote sysop access allowed */
  55. #define EXCLUDED_CMD            128     /* This user is banned from the BBS */
  56. #define NO_LISTS               1024     /* NO Lists given from this BBS */
  57.     char *path;                             /* Directory path */
  58.     char *startmsg;                 /* Message to be sent at connect through any */
  59.                             /* of the gateways */
  60.     int current;                    /* the current message number */
  61.     int nmsgs;                              /* number of messages in this mail box */
  62.     int newmsgs;                    /* number of new messages in mail box */
  63.     int change;                             /* mail file changed */
  64.     int anyread;                    /* true if any message has been read */
  65.     FILE *mfile;                    /* mail data file pointer */
  66.     char area[64];                  /* name of current mail area */
  67.     char narea[64];
  68.     long mboxsize;                  /* size of mailbox when opened */
  69.     long mysize;                    /* size of my private mailbox */
  70.     struct let *mbox;
  71.     int err_cnt;                    /* a try to stop endless "Huh?" or "Error ?" */
  72.     int security;
  73. } ;
  74. #define         NULLMBX         (struct mbx *)0
  75.  
  76. /* Structure used for automatic flushing of gateway sockets */
  77. struct gwalarm {
  78.     int s1;
  79.     int s2;
  80.     struct timer t;
  81. };
  82.  
  83. extern struct mbx *Mbox[NUMMBX] ;
  84. extern int ax25mbox ;
  85. extern char Noperm[];
  86. extern unsigned Tiptimeout;
  87. extern int ThirdParty;
  88. extern char Banner[];
  89.  
  90. /* In ax_mbx.c: */
  91. void mbx_incom __ARGS((int s,void *t,void *p));
  92. int domboxdisplay __ARGS((int argc,char *argv[],void *p));
  93. struct mbx *newmbx __ARGS((void));
  94. void exitbbs __ARGS((struct mbx *m));
  95. int domboxbye __ARGS((int argc,char *argv[],void *p));
  96. int mbx_parse __ARGS((struct mbx *m));
  97. void changearea __ARGS((struct mbx *m,char *area));
  98. char *rewrite_address __ARGS((char *addr));
  99.  
  100. /* In forward.c: */
  101. int dorevfwd __ARGS((int argc,char *argv[],void *p));
  102. int dombtimer __ARGS((int argc,char *argv[],void *p));
  103. int dombkick __ARGS((int argc,char *argv[],void *p));
  104.  
  105. #endif  /* _MAILBOX_H */
  106.  
  107.